package com.zyy.mvcframework.pojo;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.*;
import java.util.regex.Pattern;

/**
 * @author zyy
 * @date 2020/12/8 11:52 下午
 * @description
 */
public class Handler {
    /**
     * 实体对象 beans
     */
    private Object obj;
    /**
     * 对应的方法
     */
    private Method method;
    /**
     * springurl是支持正则的
     * 可以匹配的url
     */
    private Pattern pattern;
    /**
     * 参数map,将参数按顺序放入map中，是为了进行参数绑定，key是参数名，value代表第几个参数
     * <name,2>
     */
    private Map<String,Integer> paramIndexMapping;

    /**
     * zhangsan
     * lisi
     * wangwu
     */
    private Set<String> securityNames;

    public Handler(Object obj, Method method, Pattern pattern ,Set<String> securityNames) {
        this.obj = obj;
        this.method = method;
        this.pattern = pattern;
        this.paramIndexMapping = new HashMap<>();
        this.securityNames = securityNames;
    }

    public Set<String> getSecurityNames() {
        return securityNames;
    }

    public void setSecurityNames(Set<String> securityNames) {
        this.securityNames = securityNames;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Map<String, Integer> getParamIndexMapping() {
        return paramIndexMapping;
    }

    public void setParamIndexMapping(Map<String, Integer> paramIndexMapping) {
        this.paramIndexMapping = paramIndexMapping;
    }
}
